import { defineComponent } from 'vue'
import type { PropType } from 'vue'
import type { JsonSchema, Slots } from '../types'

export default defineComponent({
  inheritAttrs: true,
  props: {
    schema: {
      type: Object as PropType<JsonSchema>,
      default: () => ({})
    },
    slots: {
      type: Object as PropType<Slots>,
      default: () => null
    }
  },
  setup(props) {
    const _props = props.schema.props as {
      class?: string
      content?: string
    }
    return () => <div class={_props?.class ?? ''}>{_props?.content ?? ''}</div>
  }
})
